<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class MedicalFollowUp extends Model
{
    protected $table = 'st_medical_follow_ups';

    protected $fillable = [
        'record_id',
        'blood_glucose',
        'interval_evaluation',
        'interval_symptom',
        'diet',
        'sport',
        'sport_time',
        'sport_strength',
        'thyroid',
        'adrenal_gland',
        'normal',
        'remark'
    ];

    protected $casts = [
        'blood_glucose'       => 'array',
        'interval_evaluation' => 'array',
        'interval_symptom'    => 'array',
        'normal'              => 'array',
        'thyroid'             => 'array',
        'adrenal_gland'       => 'array',
        'diet'                => 'array',
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function medicalRecord()
    {
        return $this->belongsTo(MedicalRecord::class, 'record_id');
    }
}
